package io.bdmc.modules.bss.service.impl;

import io.bdmc.common.annotation.DataFilter;
import io.bdmc.common.utils.MyPage;
import io.bdmc.modules.bss.entity.BarRealtime;
import io.bdmc.modules.bss.mapper.BarRealtimeMapper;
import io.bdmc.modules.bss.model.DevDataParam;
import io.bdmc.modules.bss.service.BarRealtimeService;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 实时数据表，每个设备最新一条数据 服务实现类
 * </p>
 *
 * @author HuangLu
 * @since 2019-01-09
 */
@Service
public class BarRealtimeServiceImpl extends ServiceImpl<BarRealtimeMapper, BarRealtime> implements BarRealtimeService {

	@Autowired
	private BarRealtimeMapper realMapper;

	@Override
	public List<BarRealtime> allData() {
		return realMapper.all();
	}

	@DataFilter(tableAlias = "dev", user = false)
	@Override
	public MyPage<BarRealtime> mySelectPage(MyPage<BarRealtime> page, DevDataParam devDataParam) {
		return realMapper.mySelectPage(page, devDataParam);
	}

	@Override
	public List<Map<String, Object>> devCount() {
		return realMapper.devCount();
	}

}
